Generally in moving picture coding, information is compressed by suppressing the spatial and temporal redundancies that exist within moving pictures. As a method of suppressing the temporal redundancies, inter picture prediction coding is used. In the inter picture prediction coding, for coding a current picture, pictures temporally preceding or following the current picture are used as reference pictures. The motion of the current picture from the reference pictures is detected, and the difference between the picture obtained by motion compensation and the current picture is calculated. Then, the spatial redundancies are eliminated from this difference, so as to compress the information amount of the moving pictures.
In the conventional moving picture coding method according to the MPEG-4 standard (ISO/IEC 14496-2:1999 Information technology, Coding of audio-visual objects-Part 2: Visual, pp. 146-148) (hereinafter referred to as MPEG-4) and the like, there are three types of pictures. I-pictures (Intra Coded Pictures) are coded not using inter picture prediction, but intra coded. P-pictures (Predictive Coded Pictures) are coded using inter picture prediction with reference to one preceding picture. B-pictures (Bi-directional Predictive Coded Pictures) are coded using inter picture prediction with reference to one preceding picture (I-picture or P-picture) and one following picture (I-picture or P-picture). FIG. 15 illustrates predictive relations between respective pictures in the above-mentioned moving picture coding method. In FIG. 15, vertical lines show pictures, and picture types (I, P and B) are indicated at the lower right of the respective pictures. The pictures at the heads of the arrows are coded using inter picture prediction with reference to the pictures at the other ends of the arrows. For example, the second B-picture is coded using the first I-picture and the fourth P-picture as reference pictures.
According to the MPEG-4 standard, for coding motion vectors, a difference between a motion vector of a current block and a predicted vector obtained from the motion vectors for the neighboring blocks is coded. Since the motion vectors of the neighboring blocks usually have similar motion size and direction on the spatial coordinate to the motion vectors for the current block, the coding amount of the motion vectors can be reduced by calculating the difference from the predicted vector obtained from the motion vectors of the neighboring blocks. How to code motion vectors according to MPEG-4 will be explained with reference to FIGS. 16A˜16D. In these figures, blocks indicated in boldface are macroblocks of 16×16 pixels, and there exist 4 blocks of 8×8 pixels in each macroblock. In FIG. 16A˜16D, the motion vector (MV) of each block is coded based on the difference from the predicted vector obtained from the motion vectors (MV1, MV2 and MV3) of the three neighboring blocks. As this predicted vector, medians calculated respectively from the horizontal and vertical components of these three motion vectors MV1, MV2 and MV3 are used. However, a neighboring block has sometimes no motion vector, for example when it is intra coded or it is coded as a B-picture in direct mode. If one of the neighboring blocks is a block of this type, the motion vector for the block is considered equal to 0. If two of the neighboring blocks are blocks of this type, the motion vector of the remaining one block is used as a predicted vector. And when all of the neighboring blocks have no motion vector, the motion vector of the current block is coded on the assumption that the predicted vector is 0.
Meanwhile, H.26L method, which has been developed for standardization, proposes a new coding method of B-pictures. B-pictures are traditionally coded using one previously coded preceding picture and one previously coded following picture as reference pictures, but in the new coding method, B-pictures are coded using two previously coded preceding pictures, two previously coded following pictures, or one previously coded preceding picture and one previously coded following picture.
In the conventional motion vector coding method, even if the neighboring blocks in a B-picture respectively have two motion vectors toward the preceding reference pictures or two motion vectors toward the following reference pictures, there is no definite and unified method of determining which one of these two vectors should be used as a predicted vector, and thus there is no efficient coding method of the determined motion vector.
The present invention is directed to solving the above-mentioned problem. It is an object of the present invention to provide motion vector coding and decoding methods capable of unifying the method of determining a predicted vector for coding a motion vector, and improving predictability.